
#ifndef __TILED_TILEDDEFS_H__
#define __TILED_TILEDDEFS_H__

#include <string>
#include <map>
#include "base/CCRef.h"
#include "renderer/CCTexture2D.h"

USING_NS_CC;

namespace tinyxml2 {
	class XMLElement;
}

namespace Tiled
{

	class PropertySet
	{
	public:
		void load(const tinyxml2::XMLElement* element);
		bool has(const std::string& name) const;
		std::string get(const std::string& name) const;

	protected:
		std::map<std::string, std::string> _nameToValueMapping;
	};

	class LayerData : public Ref
	{
	public:
		LayerData()
			: size(0, 0)
			, name("")
			, visible(true)
			, opacity(255)
		{
		}

		virtual bool load(const tinyxml2::XMLElement* element);

		Size size;
		std::string name;
		int opacity;
		bool visible;

		PropertySet properties;
	};

} //end of namespace Tiled

#endif //__TILED_TILEDDEFS_H__
